<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    // 将类赋值给一个变量
    let a = class animal{
        constructor(w,c){
            this.weight = w;
            this.color = c;
        }
        move(){
             console.log('会动');
        }
    }

    // 通过类去创建对象
    let mao = new a('100g','黑色');
    console.log(mao.color);


</script>


</body>
</html>